﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Collections;
using SteriaMummert.SharePoint.SoftwareFactoryLite.Editors;
using System.Drawing.Design;
using Microsoft.Practices.ComponentModel;
using EnvDTE;

namespace SMC.SPALM.Types
{
    [ServiceDependency(typeof(DTE))]
    [Browsable(true)]
    [TypeConverter(typeof(ExpandableObjectConverter)), CategoryAttribute("Migration Settings")]
    public class SiteColumn
    {
        private string _ID = Guid.NewGuid().ToString();
        private string _Name = "";
        private string _StaticName = "";
        private string _Group = "";
        private string _ColName = "";
        private string _RowOrdinal = "";
        private bool _ReadOnly = false;
        private SiteColumnType _Type = SiteColumnType.Text;
        private string _DisplayName = "";

        /*
        Required = "TRUE" | "FALSE"
        ShowField = "Text" | "Choice" | "Counter"
    ShowInDisplayForm = "TRUE" | "FALSE"
  ShowInEditForm = "TRUE" | "FALSE"
  ShowInFileDlg = "TRUE" | "FALSE"
  ShowInNewForm = "TRUE" | "FALSE"
  Sortable = "TRUE" | "FALSE"
        Hidden = "TRUE" | "FALSE"
        Filterable = "TRUE" | "FALSE"
        */

        public SiteColumn()
        {
        }

		[Category("TestProperties")] 
		public string Name
		{
			get{return _Name;}
			set{_Name= value;}
		}

		[Category("TestProperties")]
        public string ID
		{
            get { return _ID; }
            set { _ID = value; }
		}

        [Category("TestProperties")]
        [Editor(typeof(SharePointConfigurationSiteColumnGroupEditor), typeof(UITypeEditor))]
        public string Group
        {
            get { return _Group; }
            set { _Group = value; }
        }

        [Category("TestProperties")]
        public string StaticName
        {
            get { return _StaticName; }
            set { _StaticName = value; }
        }

        [Category("TestProperties")]
        public string ColName
        {
            get { return _ColName; }
            set { _ColName = value; }
        }

        [Category("TestProperties")]
        public string RowOrdinal
        {
            get { return _RowOrdinal; }
            set { _RowOrdinal = value; }
        }

        [Category("TestProperties")]
        public bool ReadOnly
        {
            get { return _ReadOnly; }
            set { _ReadOnly = value; }
        }

        [Category("TestProperties")]
        public SiteColumnType Type
        {
            get { return _Type; }
            set { _Type = value; }
        }

        [Category("TestProperties")]
        public string DisplayName
        {
            get { return _DisplayName; }
            set { _DisplayName = value; }
        }


    }

    public enum SiteColumnType
    {
        Attachments = 1,
        Boolean = 2,
        Calculated = 3,
        Choice = 4,
        Computed = 5,
        Currency = 6,
        DateTime = 7,
        File = 8,
        GridChoice = 9,
        Guid = 10,
        Integer = 11,
        Lookup = 12,
        LookupMulti = 13,
        MultiChoice = 14,
        MultiColumn = 15,
        Note = 16,
        Number = 17,
        Text = 18,
        URL = 19,
        User = 20,
        UserMulti = 21,
        WorkflowEventType = 22,
        WorkflowStatus = 23
    }
}
